package com.dmx.fw.web.struts2.views.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.CheckboxTag;

import com.dmx.fw.web.struts2.components.ExtCheckbox;
import com.opensymphony.xwork2.util.ValueStack;

public class ExtCheckboxTag extends CheckboxTag {

	protected String pageState;
	protected String addState;
	protected String editState;
	protected String viewState;
	protected String params;
	protected String outHidden;
	protected String checkValue;
	protected String unCheckValue;
	protected String checkCaption;
	protected String unCheckCaption;

	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res) {
		return new ExtCheckbox(stack, req, res);
	}

	protected void populateParams() {
		super.populateParams();

		ExtCheckbox extCheckbox = ((ExtCheckbox) component);
		extCheckbox.setPageState(pageState);
		extCheckbox.setAddState(addState);
		extCheckbox.setEditState(editState);
		extCheckbox.setViewState(viewState);
		extCheckbox.setParams(params);
		extCheckbox.setOutHidden(outHidden);
		extCheckbox.setCheckValue(checkValue);
		extCheckbox.setCheckCaption(checkCaption);
		extCheckbox.setUnCheckValue(unCheckValue);
		extCheckbox.setUnCheckCaption(unCheckCaption);

	}

	public void setPageState(String pageState) {
		this.pageState = pageState;
	}

	public void setAddState(String addState) {
		this.addState = addState;
	}

	public void setEditState(String editState) {
		this.editState = editState;
	}

	public void setViewState(String viewState) {
		this.viewState = viewState;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public void setOutHidden(String outHidden) {
		this.outHidden = outHidden;
	}

	public void setCheckValue(String checkValue) {
		this.checkValue = checkValue;
	}

	public void setUnCheckValue(String unCheckValue) {
		this.unCheckValue = unCheckValue;
	}

	public void setCheckCaption(String checkCaption) {
		this.checkCaption = checkCaption;
	}

	public void setUnCheckCaption(String unCheckCaption) {
		this.unCheckCaption = unCheckCaption;
	}

}
